<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>获取div</title>
	</head>
	<body>
<!-- 		2.新制作一个页面，要求：
		       2.1 至少包含以下元素：3个DIV,标题，5个P标签，图片，列表 
		       2.2 分别实现 id,类，标签三种方式查找以上元素 -->
		<div id="div1" name='div1' class="basediv1">
			<h1 id="title1">标题</h1>
			<button type="button" onclick="getdiv1();">获取div1</button>
		</div>
		<div id="div2" name='div2' class="basediv2">
			<p id='p1'>a</p>
			<p>b</p>
			<p>c</p>
			<p>d</p>
			<p>e</p>
			<button type="button" onclick="getdiv2();">获取div2</button>
		</div>
		<div id="div3" name='div3' class='basediv3'>
			<img src="../img/%7D$ATTN0C~_DADYN8X_Q$RON.jpg">
			<br />
			<button type="button" onclick="getdiv3();">获取div3</button>
		</div>
	</body>
	<script type="text/javascript">
		function getdiv1(){
			var div1get1 = document.getElementById('div1');
			console.log(div1get1);
			var div1get2 = document.getElementsByName('div1');
			console.log(div1get2);
			var div1get3 = document.getElementsByClassName('basediv1');
			console.log(div1get3);
			var div1get4 = document.getElementsByTagName('h1');
			console.log(div1get4);
		};
		function getdiv2(){
			var div2get1 = document.getElementById('div2');
			console.log(div2get1);
			var div2get2 = document.getElementsByName('div2');
			console.log(div2get2);
			var div2get3 = document.getElementsByClassName('basediv2');
			console.log(div2get3);
			var div2get4 = document.getElementsByTagName('p');
			console.log(div2get4);
		};
		function getdiv3(){
			var div3get1 = document.getElementById('div3');
			console.log(div3get1);
			var div3get2 = document.getElementsByName('div2');
			console.log(div3get2);
			var div3get3 = document.getElementsByClassName('basediv3');
			console.log(div3get3);
			var div3get4 = document.getElementsByTagName('img');
			console.log(div3get4);
		};
	</script>
</html>
